Source:NetHack 3.3.0/youprop.h
Below is the full text to youprop.h from the source code of NetHack 3.3.0. To link to a particular line, write [[NetHack 3.3.0/youprop.h#line123]], for example. Warning! This is the source code from an old release. For the latest release, see Source code 1. /* SCCS Id: @(#)youprop.h 3.3 99/07/02 */ 2. /* Copyright © 1989 Mike Threepoint */ 3. /* NetHack may be freely redistributed. See license for details. */ 4. 5. #ifndef YOUPROP_H 6. #define YOUPROP_H 7. 8. #include "prop.h" 9. #include "permonst.h" 10. #include "mondata.h" 11. #include "pm.h" 12. 13. 14. /* KMH, intrinsics patch. 15. * Reorganized and rewritten for >32-bit properties. 16. * HXxx refers to intrinsic bitfields while in human form. 17. * EXxx refers to extrinsic bitfields from worn objects. 18. * BXxx refers to the cause of the property being blocked. 19. * Xxx refers to any source, including polymorph forms. 20. */ 21. 22. 23. #define maybe_polyd(if_so,if_not) (Upolyd ? (if_so) : (if_not)) 24. 25. 26. /*** Resistances to troubles ***/ 27. /* With intrinsics and extrinsics */ 28. #define HFire_resistance u.upropsFIRE_RES.intrinsic 29. #define EFire_resistance u.upropsFIRE_RES.extrinsic 30. #define Fire_resistance (HFire_resistance || EFire_resistance || \ 31. resists_fire(&youmonst)) 32. 33. #define HCold_resistance u.upropsCOLD_RES.intrinsic 34. #define ECold_resistance u.upropsCOLD_RES.extrinsic 35. #define Cold_resistance (HCold_resistance || ECold_resistance || \ 36. resists_cold(&youmonst)) 37. 38. #define HSleep_resistance u.upropsSLEEP_RES.intrinsic 39. #define ESleep_resistance u.upropsSLEEP_RES.extrinsic 40. #define Sleep_resistance (HSleep_resistance || ESleep_resistance || \ 41. resists_sleep(&youmonst)) 42. 43. #define HDisint_resistance u.upropsDISINT_RES.intrinsic 44. #define EDisint_resistance u.upropsDISINT_RES.extrinsic 45. #define Disint_resistance (HDisint_resistance || EDisint_resistance || \ 46. resists_disint(&youmonst)) 47. 48. #define HShock_resistance u.upropsSHOCK_RES.intrinsic 49. #define EShock_resistance u.upropsSHOCK_RES.extrinsic 50. #define Shock_resistance (HShock_resistance || EShock_resistance || \ 51. resists_elec(&youmonst)) 52. 53. #define HPoison_resistance u.upropsPOISON_RES.intrinsic 54. #define EPoison_resistance u.upropsPOISON_RES.extrinsic 55. #define Poison_resistance (HPoison_resistance || EPoison_resistance || \ 56. resists_poison(&youmonst)) 57. 58. #define HDrain_resistance u.upropsDRAIN_RES.intrinsic 59. #define EDrain_resistance u.upropsDRAIN_RES.extrinsic 60. #define Drain_resistance (HDrain_resistance || EDrain_resistance || \ 61. resists_drli(&youmonst)) 62. 63. /* Intrinsics only */ 64. #define HSick_resistance u.upropsSICK_RES.intrinsic 65. #define Sick_resistance (HSick_resistance || \ 66. youmonst.data->mlet S_FUNGUS || \ 67. defends(AD_DISE,uwep)) 68. #define Invulnerable u.upropsINVULNERABLE.intrinsic /* Tom */ 69. 70. /* Extrinsics only */ 71. #define EAntimagic u.upropsANTIMAGIC.extrinsic 72. #define Antimagic (EAntimagic || \ 73. (Upolyd && resists_magm(&youmonst))) 74. 75. #define EAcid_resistance u.upropsACID_RES.extrinsic 76. #define Acid_resistance (EAcid_resistance || resists_acid(&youmonst)) 77. 78. #define EStone_resistance u.upropsSTONE_RES.extrinsic 79. #define Stone_resistance (EStone_resistance || resists_ston(&youmonst)) 80. 81. 82. /*** Troubles ***/ 83. /* Pseudo-property */ 84. #define Punished (uball) 85. 86. /* Those implemented solely as timeouts (we use just intrinsic) */ 87. #define HStun u.upropsSTUNNED.intrinsic 88. #define Stunned (HStun || u.umonnum PM_STALKER || \ 89. youmonst.data->mlet S_BAT) 90. /* Note: birds will also be stunned */ 91. 92. #define HConfusion u.upropsCONFUSION.intrinsic 93. #define Confusion HConfusion 94. 95. #define Blinded u.upropsBLINDED.intrinsic 96. #define Blindfolded (ublindf && ublindf->otyp != LENSES) 97. /* ...means blind because of a cover */ 98. #define Blind ((Blinded || Blindfolded || !haseyes(youmonst.data)) && \ 99. !(ublindf && ublindf->oartifact ART_EYES_OF_THE_OVERWORLD)) 100. /* ...the Eyes operate even when you really are blind 101. or don't have any eyes */ 102. 103. #define Sick u.upropsSICK.intrinsic 104. #define Stoned u.upropsSTONED.intrinsic 105. #define Strangled u.upropsSTRANGLED.intrinsic 106. #define Vomiting u.upropsVOMITING.intrinsic 107. #define Glib u.upropsGLIB.intrinsic 108. #define Slimed u.upropsSLIMED.intrinsic /* Tom */ 109. 110. /* Hallucination is solely a timeout; its resistance is extrinsic */ 111. #define HHallucination u.upropsHALLUC.intrinsic 112. #define EHalluc_resistance u.upropsHALLUC_RES.extrinsic 113. #define Halluc_resistance (EHalluc_resistance || \ 114. (Upolyd && dmgtype(youmonst.data, AD_HALU))) 115. #define Hallucination (HHallucination && !Halluc_resistance) 116. 117. /* Timeout, plus a worn mask */ 118. #define HFumbling u.upropsFUMBLING.intrinsic 119. #define EFumbling u.upropsFUMBLING.extrinsic 120. #define Fumbling (HFumbling || EFumbling) 121. 122. #define HWounded_legs u.upropsWOUNDED_LEGS.intrinsic 123. #define EWounded_legs u.upropsWOUNDED_LEGS.extrinsic 124. #define Wounded_legs (HWounded_legs || EWounded_legs) 125. 126. #define HSleeping u.upropsSLEEPING.intrinsic 127. #define ESleeping u.upropsSLEEPING.extrinsic 128. #define Sleeping (HSleeping || ESleeping) 129. 130. #define HHunger u.upropsHUNGER.intrinsic 131. #define EHunger u.upropsHUNGER.extrinsic 132. #define Hunger (HHunger || EHunger) 133. 134. 135. /*** Vision and senses ***/ 136. #define HSee_invisible u.upropsSEE_INVIS.intrinsic 137. #define ESee_invisible u.upropsSEE_INVIS.extrinsic 138. #define See_invisible (HSee_invisible || ESee_invisible || \ 139. perceives(youmonst.data)) 140. 141. #define HTelepat u.upropsTELEPAT.intrinsic 142. #define ETelepat u.upropsTELEPAT.extrinsic 143. #define Blind_telepat (HTelepat || ETelepat || \ 144. telepathic(youmonst.data)) 145. #define Unblind_telepat (ETelepat) 146. 147. #define HWarning u.upropsWARNING.intrinsic 148. #define EWarning u.upropsWARNING.extrinsic 149. #define Warning (HWarning || EWarning) 150. 151. #define HUndead_warning u.upropsWARN_UNDEAD.intrinsic 152. #define Undead_warning (HUndead_warning) 153. 154. #define HSearching u.upropsSEARCHING.intrinsic 155. #define ESearching u.upropsSEARCHING.extrinsic 156. #define Searching (HSearching || ESearching) 157. 158. #define HClairvoyant u.upropsCLAIRVOYANT.intrinsic 159. #define EClairvoyant u.upropsCLAIRVOYANT.extrinsic 160. #define BClairvoyant u.upropsCLAIRVOYANT.blocked 161. #define Clairvoyant ((HClairvoyant || EClairvoyant) &&\ 162. !BClairvoyant) 163. 164. #define HInfravision u.upropsINFRAVISION.intrinsic 165. #define EInfravision u.upropsINFRAVISION.extrinsic 166. #define Infravision (HInfravision || EInfravision || \ 167. infravision(youmonst.data)) 168. 169. #define HDetect_monsters u.upropsDETECT_MONSTERS.intrinsic 170. #define EDetect_monsters u.upropsDETECT_MONSTERS.extrinsic 171. #define Detect_monsters (HDetect_monsters || EDetect_monsters) 172. 173. 174. /*** Appearance and behavior ***/ 175. #define Adornment u.upropsADORNED.extrinsic 176. 177. #define HInvis u.upropsINVIS.intrinsic 178. #define EInvis u.upropsINVIS.extrinsic 179. #define BInvis u.upropsINVIS.blocked 180. #define Invis ((HInvis || EInvis || \ 181. pm_invisible(youmonst.data)) && !BInvis) 182. #define Invisible (Invis && !See_invisible) 183. 184. #define EDisplaced u.upropsDISPLACED.extrinsic 185. #define Displaced EDisplaced 186. 187. #define HStealth u.upropsSTEALTH.intrinsic 188. #define EStealth u.upropsSTEALTH.extrinsic 189. #define BStealth u.upropsSTEALTH.blocked 190. #define Stealth ((HStealth || EStealth) && !BStealth) 191. 192. #define HAggravate_monster u.upropsAGGRAVATE_MONSTER.intrinsic 193. #define EAggravate_monster u.upropsAGGRAVATE_MONSTER.extrinsic 194. #define Aggravate_monster (HAggravate_monster || EAggravate_monster) 195. 196. #define HConflict u.upropsCONFLICT.intrinsic 197. #define EConflict u.upropsCONFLICT.extrinsic 198. #define Conflict (HConflict || EConflict) 199. 200. 201. /*** Transportation ***/ 202. #define HJumping u.upropsJUMPING.intrinsic 203. #define EJumping u.upropsJUMPING.extrinsic 204. #define Jumping (HJumping || EJumping) 205. 206. #define HTeleportation u.upropsTELEPORT.intrinsic 207. #define ETeleportation u.upropsTELEPORT.extrinsic 208. #define Teleportation (HTeleportation || ETeleportation || \ 209. can_teleport(youmonst.data)) 210. 211. #define HTeleport_control u.upropsTELEPORT_CONTROL.intrinsic 212. #define ETeleport_control u.upropsTELEPORT_CONTROL.extrinsic 213. #define Teleport_control (HTeleport_control || ETeleport_control || \ 214. control_teleport(youmonst.data)) 215. 216. #define HLevitation u.upropsLEVITATION.intrinsic 217. #define ELevitation u.upropsLEVITATION.extrinsic 218. #define Levitation (HLevitation || ELevitation || \ 219. is_floater(youmonst.data)) 220. /* Can't touch surface, can't go under water; overrides all others */ 221. #define Lev_at_will (((HLevitation & I_SPECIAL) != 0L || \ 222. (ELevitation & W_ARTI) != 0L) && \ 223. (HLevitation & ~(I_SPECIAL|TIMEOUT)) 0L && \ 224. (ELevitation & ~W_ARTI) 0L && \ 225. !is_floater(youmonst.data)) 226. 227. #define EFlying u.upropsFLYING.extrinsic 228. #ifdef STEED 229. # define Flying (EFlying || is_flyer(youmonst.data) || \ 230. (u.usteed && is_flyer(u.usteed->data))) 231. #else 232. # define Flying (EFlying || is_flyer(youmonst.data)) 233. #endif 234. /* May touch surface; does not override any others */ 235. 236. #define Wwalking (u.upropsWWALKING.extrinsic && \ 237. !Is_waterlevel(&u.uz)) 238. /* Don't get wet, can't go under water; overrides others except levitation */ 239. /* Wwalking is meaningless on water level */ 240. 241. #define HSwimming u.upropsSWIMMING.intrinsic 242. #define ESwimming u.upropsSWIMMING.extrinsic /* Tom */ 243. #ifdef STEED 244. # define Swimming (HSwimming || ESwimming || \ 245. is_swimmer(youmonst.data) || \ 246. (u.usteed && is_swimmer(u.usteed->data))) 247. #else 248. # define Swimming (HSwimming || ESwimming || \ 249. is_swimmer(youmonst.data)) 250. #endif 251. /* Get wet, don't go under water unless if amphibious */ 252. 253. #define HMagical_breathing u.upropsMAGICAL_BREATHING.intrinsic 254. #define EMagical_breathing u.upropsMAGICAL_BREATHING.extrinsic 255. #define Amphibious (HMagical_breathing || EMagical_breathing || \ 256. amphibious(youmonst.data)) 257. /* Get wet, may go under surface */ 258. 259. #define Breathless (HMagical_breathing || EMagical_breathing || \ 260. breathless(youmonst.data)) 261. 262. #define Underwater (u.uinwater) 263. /* Note that Underwater and u.uinwater are both used in code. 264. The latter form is for later implementation of other in-water 265. states, like swimming, wading, etc. */ 266. 267. #define HPasses_walls u.upropsPASSES_WALLS.intrinsic 268. #define EPasses_walls u.upropsPASSES_WALLS.extrinsic 269. #define Passes_walls (HPasses_walls || EPasses_walls || \ 270. passes_walls(youmonst.data)) 271. 272. 273. /*** Physical attributes ***/ 274. #define HSlow_digestion u.upropsSLOW_DIGESTION.intrinsic 275. #define ESlow_digestion u.upropsSLOW_DIGESTION.extrinsic 276. #define Slow_digestion (HSlow_digestion || ESlow_digestion) /* KMH */ 277. 278. #define HHalf_spell_damage u.upropsHALF_SPDAM.intrinsic 279. #define EHalf_spell_damage u.upropsHALF_SPDAM.extrinsic 280. #define Half_spell_damage (HHalf_spell_damage || EHalf_spell_damage) 281. 282. #define HHalf_physical_damage u.upropsHALF_PHDAM.intrinsic 283. #define EHalf_physical_damage u.upropsHALF_PHDAM.extrinsic 284. #define Half_physical_damage (HHalf_physical_damage || EHalf_physical_damage) 285. 286. #define HRegeneration u.upropsREGENERATION.intrinsic 287. #define ERegeneration u.upropsREGENERATION.extrinsic 288. #define Regeneration (HRegeneration || ERegeneration || \ 289. regenerates(youmonst.data)) 290. 291. #define HEnergy_regeneration u.upropsENERGY_REGENERATION.intrinsic 292. #define EEnergy_regeneration u.upropsENERGY_REGENERATION.extrinsic 293. #define Energy_regeneration (HEnergy_regeneration || EEnergy_regeneration) 294. 295. #define HProtection u.upropsPROTECTION.intrinsic 296. #define EProtection u.upropsPROTECTION.extrinsic 297. #define Protection (HProtection || EProtection) 298. 299. #define HProtection_from_shape_changers \ 300. u.upropsPROT_FROM_SHAPE_CHANGERS.intrinsic 301. #define EProtection_from_shape_changers \ 302. u.upropsPROT_FROM_SHAPE_CHANGERS.extrinsic 303. #define Protection_from_shape_changers \ 304. (HProtection_from_shape_changers || \ 305. EProtection_from_shape_changers) 306. 307. #define HPolymorph u.upropsPOLYMORPH.intrinsic 308. #define EPolymorph u.upropsPOLYMORPH.extrinsic 309. #define Polymorph (HPolymorph || EPolymorph) 310. 311. #define HPolymorph_control u.upropsPOLYMORPH_CONTROL.intrinsic 312. #define EPolymorph_control u.upropsPOLYMORPH_CONTROL.extrinsic 313. #define Polymorph_control (HPolymorph_control || EPolymorph_control) 314. 315. #define HUnchanging u.upropsUNCHANGING.intrinsic 316. #define EUnchanging u.upropsUNCHANGING.extrinsic 317. #define Unchanging (HUnchanging || EUnchanging) /* KMH */ 318. 319. #define HFast u.upropsFAST.intrinsic 320. #define EFast u.upropsFAST.extrinsic 321. #define Fast (HFast || EFast) 322. #define Very_fast ((HFast & ~INTRINSIC) || EFast) 323. 324. #define EReflecting u.upropsREFLECTING.extrinsic 325. #define Reflecting (EReflecting || \ 326. (youmonst.data &monsPM_SILVER_DRAGON)) 327. 328. #define Free_action u.upropsFREE_ACTION.extrinsic /* Tom */ 329. 330. #define Fixed_abil u.upropsFIXED_ABIL.extrinsic /* KMH */ 331. 332. #define Lifesaved u.upropsLIFESAVED.extrinsic 333. 334. 335. #endif /* YOUPROP_H */ youprop.h